import React, { useEffect, useState } from 'react'
import { getList } from '../../api/us'
import Mylist from '../../compont/Mylist'
import useLogin from '../../hook/useLogin'

const Index = () => {
    const { islogin } = useLogin()
    const [list, setList] = useState([])
    const getlist = async () => {
        const res = await getList()
        setList(res.rows)
        console.log(res);
    }
    useEffect(() => {
        getlist()
    }, [])
    return (
        <div>
            {
                list.map((item, i) => (
                    <Mylist key={i} {...item} />
                ))
            }
        </div>
    )
}

export default Index
